package log

import (
	//"flag"
	"runtime"

	"github.com/golang/glog"
)

var (
	srv []interface{}
)

func Init(_servername, _ip string, _port int) {
	//flag.Parse()
	srv = make([]interface{}, 0)
	srv = append(srv, _servername, _ip, _port)
}
func runFuncName() (string, string, int) {
	pc, file, line, _ := runtime.Caller(2)
	f := runtime.FuncForPC(pc)
	return f.Name(), file, line
}

func Errorln(args ...interface{}) {
	method, _, _ := runFuncName()
	glog.ErrorDepth(1, method, srv, args)
}

func Infoln(args ...interface{}) {
	method, _, _ := runFuncName()
	glog.InfoDepth(1, method, srv, args)
}
func Warningln(args ...interface{}) {
	method, _, _ := runFuncName()
	glog.WarningDepth(1, method, srv, args)
}
func Exitln(args ...interface{}) {
	method, _, _ := runFuncName()
	glog.ExitDepth(1, method, srv, args)
}
func Flush() {
	glog.Flush()
}
